#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 2e5 + 5;
const int INF = 1e9;

int n, m;
int a[N], b[N];
int id[N], f[N];  // b[id[i] - 1] <= a[i], b[id[i]] > a[i]
int dp[N][2];
bool sad(int i, int j) {
  if (id[i] != id[j] - 1) return false;
  int d1 = b[id[i]] - a[i], d2 = a[j] - b[id[i]];
  return d1 != d2;
}
void solve() {
  int y0, y1;
  cin >> n >> m >> y0 >> y1;
  rep(i, 1, n) cin >> a[i];
  rep(i, 1, m) cin >> b[i];
  b[0] = -1e9, b[m + 1] = 1e9;
  rep(i, 1, n) {
    id[i] = upper_bound(b + 1, b + m + 1, a[i]) - b;
    int d = b[id[i]] + b[id[i] - 1];
    if (a[i] * 2 < d)
      f[i] = 0;
    else if (a[i] * 2 > d)
      f[i] = 1;
    else
      f[i] = 2;
  }
  if (f[1] == 2)
    dp[1][0] = dp[1][1] = 0;
  else
    dp[1][f[1]] = 0, dp[1][f[1] ^ 1] = INF;
  rep(i, 2, n) {
    if (f[i] == 2) {
      // 0
      // 0 0
      int x = dp[i - 1][0] + (id[i] == id[i - 1] ? 1 : 0);
      // 1 0
      int y = dp[i - 1][1] + (sad(i - 1, i) ? 1 : 0);
      dp[i][0] = min(x, y);
      // 1
      // 0 1
      x = dp[i - 1][0];
      // 1 1
      y = dp[i - 1][1] + (id[i] == id[i - 1] ? 1 : 0);
      dp[i][1] = min(x, y);
    } else if (f[i] == 0) {
      dp[i][1] = INF;
      // 0 0
      int x = dp[i - 1][0] + (id[i] == id[i - 1] ? 1 : 0);
      // 1 0
      int y = dp[i - 1][1] + (sad(i - 1, i) ? 1 : 0);
      dp[i][0] = min(x, y);
    } else {  // f[i] == 1
      dp[i][0] = INF;
      // 1
      // 0 1
      int x = dp[i - 1][0];
      // 1 1
      int y = dp[i - 1][1] + (id[i] == id[i - 1] ? 1 : 0);
      dp[i][1] = min(x, y);
    }
  }
  cout << min(dp[n][0], dp[n][1]);
  return;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int t = 1;
  while (t--) solve();
  return 0;
}